package org.jeecg.config.oss;

import org.jeecg.common.util.oss.StsOssTokenUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * STS 云存储 配置
 * @author: jeecg-boot
 */
@Configuration
public class StsConfiguration {;
    @Value("${jeecg.sts.accessKeyId}")
    private String accessKeyId;
    @Value("${jeecg.sts.accessKeySecret}")
    private String accessKeySecret;
    @Value("${jeecg.sts.roleArn}")
    private String roleArn;
    @Value("${jeecg.sts.endPoint}")
    private String endPoint;
    @Bean
    public void initStsConfiguration() {
        StsOssTokenUtil.setAccessKeyId(accessKeyId);
        StsOssTokenUtil.setAccessKeySecret(accessKeySecret);
        StsOssTokenUtil.setEndpoint(endPoint);
        StsOssTokenUtil.setRoleArn(roleArn);
    }

}
